package com.sqlsession;

import com.sqlsession.database.DbType;
import com.sqlsession.filter.DbFilter;

public class SqlInfo {
    private String port;
    private String userName;
    private String password;
    private String name;
    private String host;
    private DbType dbType;

    private DbFilter filter;
    private String desc;

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public DbFilter getFilter() {
        return filter;
    }

    public void setFilter(DbFilter filter) {
        this.filter = filter;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public DbType getDbType() {
        return dbType;
    }

    public void setDbType(DbType dbType) {
        this.dbType = dbType;
    }


    public static final class SqlInfoBuilder {
        private SqlInfo sqlInfo;

        private SqlInfoBuilder() {
            sqlInfo = new SqlInfo();
        }

        public static SqlInfoBuilder aSqlInfo() {
            return new SqlInfoBuilder();
        }

        public SqlInfoBuilder port(String port) {
            sqlInfo.setPort(port);
            return this;
        }

        public SqlInfoBuilder userName(String userName) {
            sqlInfo.setUserName(userName);
            return this;
        }

        public SqlInfoBuilder password(String password) {
            sqlInfo.setPassword(password);
            return this;
        }

        public SqlInfoBuilder databaseName(String name) {
            sqlInfo.setName(name);
            return this;
        }

        public SqlInfoBuilder host(String host) {
            sqlInfo.setHost(host);
            return this;
        }

        public SqlInfoBuilder dbType(DbType dbType) {
            sqlInfo.setDbType(dbType);
            return this;
        }

        public SqlInfoBuilder filter(DbFilter dbFilter) {
            sqlInfo.setFilter(dbFilter);
            return this;
        }

        public SqlInfoBuilder desc(String desc) {
            sqlInfo.setDesc(desc);
            return this;
        }

        public SqlInfo build() {
            return sqlInfo;
        }
    }
}
